<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
define('DIR_WEB', '/assets/static/');
return array(
    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=>'SURVEY',

    'preload'=>array('log'),

    'import'=>array(
        'application.models.*',
        'application.components.*',
        'application.extensions.*',
        'application.helpers.*',
    ),

    'modules'=>array(
        'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'wsasqa',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters'=>array('127.0.0.1','::1'),
        ),
    ),

    'aliases' => array(
        'bootstrap' => 'application.modules.bootstrap',
    ),

    'defaultController'=>'site',
    'components'=>array(
        'user'=>array(
            'allowAutoLogin'=>true,
            'loginUrl'=>'/login',
        ),
        'db'=>require(dirname(__FILE__).'/db.php'),
        'errorHandler'=>array(
            // use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),

        'urlManager'=>array(
            'urlFormat'=>'path',
            'rules'=>require(dirname(__FILE__).'/url.php'),
            'showScriptName' => false,
        ),
        
        'authManager'=>array(
            'class' => 'CDbAuthManager',
            'defaultRoles'=>array('guest'),//默认角色 
            'itemTable' => 'authitem',//认证项表名称 
            'itemChildTable' => 'authitemchild',//认证项父子关系 
            'assignmentTable' => 'authassignment',//认证项赋权关系 
            'connectionID'=>'db'
        ),

        'errorHandler'=>array(
            // use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
        
        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'error, warning',
                ),
            ),
        ),
        'image'=>array(
            'class'=>'application.extensions.image.CImageComponent',
            // GD or ImageMagick
            'driver'=>'GD',
            // ImageMagick setup path
            'params'=>array('directory'=>'/opt/local/bin'),
        ),
    ),

    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params'=>require(dirname(__FILE__).'/params.php'),
);
